<script setup>
import NotFoundImg from '@/assets/images/404_img_1.png'
import { useRouter } from 'vue-router'

defineOptions({
  name: '/404'
})

const router = useRouter()

function onBackHome() {
  router.replace({path: '/index'})
}

</script>

<template>
  <div class="cb-container">
    <div class="box-1">
      <div class="left">
        <img :src="NotFoundImg" alt="NotFoundImg">
      </div>
      <div class="right">
        <div>404</div>
        <div style="font-size: 16px">
          <p>很抱歉，您访问的页面不存在</p>
          <p style="color: #cccccc">请检查您输入的网址是否正确，或者点击链接继续浏览</p>
        </div>
      </div>
    </div>
    <div class="box-2">
      <div @click="onBackHome" style="position: relative; font-size: 16px">返回首页 >>></div>
    </div>
  </div>
</template>

<style scoped lang="scss">
  .cb-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    .box-1 {
      display: flex;
      flex-direction: row;
      align-items: center;

      .right {
        display: flex;
        height: 100%;
        flex-direction: column;
        justify-content: space-between;
        margin-left: 32px;
        padding: 21px;

        &>div:first-of-type {
          font-size: 86px;
          font-weight: bold;
          color: #FF725F;
        }
      }
    }

    .box-2 {
      display: flex;
      flex-direction: row;
      justify-content: right;

      div {
        &:hover {
          cursor: pointer;
        }
      }
    }
  }
</style>
